package com.yuan.balanceflow.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yuan.balanceflow.entity.UserWallet;

import java.math.BigDecimal;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author yuan_boss
 * @since 2023-03-17
 */
public interface IUserWalletService extends IService<UserWallet> {

    /**
    * @Description: 1.查询用户钱包余额
    * @Param: id 用户id
    * @return: 用户余额
    * @Author: yuanboss
    * @Datetime: 2023/3/17 16:31
    */
    BigDecimal getUserWalletBalance(Integer id);

    /**
    * @Description: 2.用户消费100元
    * @Param: id 用户id
    * @Param: amount: 消费金额
    * @return: 退款结果
    * @Author: yuanboss
    * @Datetime: 2023/3/17 16:31
    */
    boolean userConsume(Integer id,BigDecimal amount);


    /**
    * @Description: 3.用户退款20元
    * @Param: id 用户id
    * @Param: amount 退款金额
    * @return: 退款结果
    * @Author: yuanboss
    * @Datetime: 2023/3/17 16:33
    */
    boolean userDrawBack(Integer id,BigDecimal amount);




}
